import sys

import requests

from api.base import Login


class merProductGroup(Login):
    # 添加保障服务
    def guarantee_group_add(self, name):
        data = {
            'url': '/api/admin/merchant/product/guarantee/group/add',
            'method': 'post',
            'headers': {'Authori-zation': self._mer_token},
            'json': {
                'name': name,
                'id': 0,
                'gids': '6,8,3,4,7',
            }
        }
        return self.mer_send_request(sys._getframe().f_code.co_name,data)

    #  删除保障服务
    def guarantee_group_delete(self, pid):
        data = {
            'url': f'/api/admin/merchant/product/guarantee/group/delete/{pid}',
            'method': 'post',
            'headers': {'Authori-zation': self._mer_token}
        }
        return self.mer_send_request(sys._getframe().f_code.co_name,data)
